<?php session_start();
require '../common/Utility.php';
require '../db/configuration.php';
require '../crud/CustomSecurity.class.php';
require '../crud/Users.class.php';
loadDB();
isAdmin();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
    <link rel="stylesheet" type="text/css" href="../css/page.css" />
    <link rel="stylesheet" type="text/css" href="../css/generalProduct.css" />
	<title>generalProduct</title>
	<meta name="author" content="Dimtiar Giormov">
	
</head>
<body>	
<?php include("../common/lenta.php"); ?>

<div id="main">

<?php
		require '../crud/CustomSecurity.class.php';
		require '../crud/Products.class.php';
		require '../db/configuration.php';
		require '../common/Utility.php';
		loadDB();
?>
		
<?php

		
		$crud = new Products($GLOBALS['connection']);

		if($_POST['Remove'] != null) {
			$crud->remove($_POST['id']);
		}
		$tableHeaders[0] = 'brand';
		$tableHeaders[1] = 'type';
		$tableHeaders[2] = 'quantity';
		$tableHeaders[3] = 'cena';
		$tableHeaders[4] = 'userId';
		$tableHeaders[5] = 'remove';
		list_table_raw($crud->getAllAdmin(),'products_admin.php', $tableHeaders, 'Product');

?>

</div>
</body>
</html>
